<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="/static/tailwind/output.css?v=1002">
  <style>
    @font-face{
      font-family: "AgencyFB";
      src:url("/static/assets/fonts/font-01.ttf");
      font-weight: normal;
      font-style: normal;
    }
    * {
      font-family: "AgencyFB";
    }
  </style>
</head>
<body class="bg-black overflow-hidden">
  <div class="absolute hidden left-[50%] top-[50%] -ml-[360px] -mt-[640px] scale-[0.575]"></div>
  <div id="rootEle" class="w-[720px] h-[1280px] absolute origin-center text-amber-700">
    <div id="textContainer" class="absolute top-0 left-[50%] -translate-x-[50%]">
      <p class="absolute bottom-[60px] left-0 right-0 text-[50px] font-bold text-center">{{title}}</p>
    </div>
    <div id="videoEle" class="absolute top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]"></div>
    <div id="extraContainer" class="absolute left-[50%] -translate-x-[50%]">
      <p class="text-slate-600/70 text-[20px]">视频无不良引导</p>
      <p class="text-center text-[42px] mt-[40px] font-bold">关注不迷路,点击头像看更多</p>
    </div>
  </div>
  <script>
    window.__TITLE = '{{title}}'
    window.__VIDEO_SIZE = '{{video_size}}'
    const videoEle = document.querySelector("#videoEle")
    const textContainerEle = document.querySelector("#textContainer")
    const extraContainerEle = document.querySelector("#extraContainer")
    const videoWidth = +window.__VIDEO_SIZE.split("_").shift()
    const videoHeight = +window.__VIDEO_SIZE.split("_").pop()
    const videoAspect = videoWidth / videoHeight
    const targetAspect = 720 / 1280
    let targetWidth = 720, targetHeight = 1280
    if (videoAspect > targetAspect) {
      targetHeight = 720 / videoAspect
    } else {
      targetWidth = targetHeight * videoAspect
    }

    let textContainerWidth = 640, textContainerHeight = Math.floor((1280 - targetHeight) / 2)

    textContainerEle.style.width = `${textContainerWidth}px`
    textContainerEle.style.height = `${textContainerHeight}px`

    videoEle.style.width = `${targetWidth}px`
    videoEle.style.height = `${targetHeight}px`

    extraContainerEle.style.width = `${textContainerWidth}px`
    extraContainerEle.style.top = `${textContainerHeight + targetHeight + 60}px`
    
  </script>
</body>
</html>